//
//  ABCViewController.m
//  RequestTest
//
//  Created by xntech on 13-8-19.
//  Copyright (c) 2013年 xntech. All rights reserved.
//

#import "ABCViewController.h"
#import "OMURL.h"
#import "OMHTTPConstant.h"
#import "OMHTTPRequest.h"
#import "ErrorMessage.h"
#import "UIFoundationPrefix.h"
@interface ABCViewController ()
{
    OMHTTPRequest  *reqeust;
}
@end

@implementation ABCViewController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
//    OMURL *url = [[OMURL alloc] initWithAbsoluteString:URLPREFIX];
//
//    reqeust = [[OMHTTPRequest alloc] initWithOMURL:url];
//    [reqeust setFinishBlock:^(OMHTTPRequest *request){
//        NSLog(@"fffffffffff  %@",request.responseString);
//    }];
//    [reqeust setMethod:METHOD_POST];
//    [reqeust startAsynchronous];
    
    NSLog(@"%@",[[[ErrorMessage alloc] initWithPlist:UIResourceFile(@"error.plist")] errorMessage:9999]);
    UIButton *btn = [UIButton buttonWithType:UIButtonTypeRoundedRect];
    [btn setFrame:CGRectMake(40, 0, 130, 30)];
    [self.view addSubview:btn];
    [btn addTarget:self action:@selector(click) forControlEvents:UIControlEventTouchUpInside];
//    [url release];
}
- (void)click
{
    [self dismissViewControllerAnimated:YES completion:nil];
}
- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
- (void)dealloc
{
    [reqeust release];
    [super dealloc];
}
@end
